<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>v-if="boolean" true:显示标签， false：删除标签 </h1>
        <h2 v-if="true">true:显示标签</h2>
        <h2 v-if="false">false：删除标签</h2>
        <h2 v-if="10 < 20">显示</h2>

        <!-- v-if  v-else必须和v-if紧挨着 -->
        <button @click="isHappy = !isHappy">切换</button>
        <h2 v-if="isHappy">开心--疯狂写代码</h2>
        <h2 v-else>不开心--特别疯狂写代码</h2>

        <!-- v-else if -->
        <h1>成绩：<input type="text" v-model="score"></h1>
        <h2>等级：
            <span v-if="score > 90 ">优秀</span>
            <span v-else-if="score > 80 ">良好</span>
            <span v-else-if="score > 70 ">一般</span>
            <span v-else-if="score > 60 ">及格</span>
            <span v-else>不及格</span>
        </h2>
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                isHappy:true,
                score:79
            },
            methods:{}
        })
    </script>
</body>
</html>